// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.dev3.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import io.swagger.annotations.ApiOperation;
import com.orange.boot.utils.R;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.beans.factory.annotation.Autowired;
import com.orange.boot.dev3.service.PictureService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/dev3/picture"})
@Api(
        tags = {"疾病图片板块"}
)
public class PictureController {
    @Autowired
    public PictureService pictureService;

    public PictureController() {
    }

    @ApiOperation("上传柑橘的图片，返回图片路径")
    @PostMapping({"addOrangePic"})
    public R addOrangePic(MultipartFile pic) {
        return this.pictureService.addOrangePic(pic);
    }

    @ApiOperation("根据疾病id和疾病部位id，返回图片路径和名称")
    @GetMapping({"getpicAndName/{diseaseId}/{citrusPartId}"})
    public R getpicAndName(@PathVariable String diseaseId, @PathVariable String citrusPartId) {
        return this.pictureService.getpicAndName(diseaseId, citrusPartId);
    }

    @ApiOperation("根据疾病id，返回疾病图片路径和疾病名称")
    @GetMapping({"getpicAndName/{diseaseId}"})
    public R getpicAndName(@PathVariable String diseaseId) {
        return this.pictureService.getpic(diseaseId);
    }

    @ApiOperation("根据疾病名，返回所有疾病图片集")
    @GetMapping({"getAllpic/{pictureName}"})
    public R getAllpic(@PathVariable String pictureName) {
        return this.pictureService.getAllpic(pictureName);
    }
}

